package com.demo.controller;

import cn.hutool.db.Page;
import com.demo.entity.DataBean;
import com.demo.entity.Notice;
import com.demo.entity.R;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletResponse;
import java.util.ArrayList;
import java.util.List;

@RestController
@Slf4j
@RequestMapping(value = "/sso")
public class HelloController {

    @Autowired
    private UserServiceImpl userService;

    /**
     * @param condition
     * @param page
     * @param size
     * @return
     */
    @GetMapping("rsql")
    public Object query(@RequestParam String condition,
                        @RequestParam(required = false, defaultValue = "0") int page,
                        @RequestParam(required = false, defaultValue = "20") int size) {
        userService.test(condition);
        return null;
    }

    @GetMapping("name")
    public Object query(@RequestBody User user) {
        User user2 = new User();
        User user1 = new User();
        user1.setUsername("test");
        return user1;
    }


    @RequestMapping("hello")
    public String hello() {
        return "hello";
    }
    @RequestMapping("test")
    public String test() {
        return "test";
    }
}